
import {createPage} from 'nc-lightapp-front';
import {render} from '../../../../hrpub/common/frame';
import MainAction from '../actions/main.js'
import Table from '../component/table/index.js'
import Form from '../component/form/index.js'
import './index.less'
import PubAction from '../actions/pub';
import TempAction from '../actions/temp';
import { getAppPageConfig } from '../../../../hrpub/common/utils/utils';

const MainPage = render({
    actions: {
        mainAction : MainAction,
        pubAction : PubAction,
        tempAction: TempAction
    }
})(({props, action, state}) => {
    const {main} = props
    let dom = JSON.stringify(main.json) !== '{}'?
        <React.Fragment>
            <Table
                {...props}
            />
            <Form
                {...props}
            />
            
        </React.Fragment>:null

    return(
        <React.Fragment>
            {dom}
        </React.Fragment>
    )

})

export default createPage({
    billinfo:[{
        billtype: 'grid',
        pagecode: getAppPageConfig().appcode,
        bodycode: 'handitemsetgrid'
    },{
        billtype: 'form',
        pagecode: getAppPageConfig().appcode,
        headcode: 'handcondform'
    }]
})(MainPage)